<%--
  Created by IntelliJ IDEA.
  User: cyb
  Date: 2019/3/11
  Time: 20:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:forEach items="${comments}" var="item">
    <c:if test="${item.value != null}">
        <article id="comment-id-2" class="comment-item comment-reply">
            <a class="pull-left thumb-sm">
                <img src="../${item.key.user.head}" class="img-circle">
            </a>
            <section class="comment-body m-b">
                <header>
                    <a href="../profile?id=${item.key.user.id}"><strong>${item.key.user.name}</strong></a>&nbsp;&nbsp;回复&nbsp;&nbsp;
                    <a href="../profile?id=${item.value.id}"><strong>${item.value.name}</strong></a>
                    <span class="text-muted text-xs block m-t-xs">${item.key.date}</span>
                </header>
                <div class="m-t-sm">${item.key.content}</div>
            </section>
        </article>
    </c:if>
    <c:if test="${item.value == null}">
        <article id="comment-id-1" class="comment-item">
            <a class="pull-left thumb-sm">
                <img src="../${item.key.user.head}" class="img-circle">
            </a>
            <section class="comment-body m-b">
                <header>
                    <a href="../profile?id=${item.key.user.id}"><strong>${item.key.user.name}</strong></a>
                    <span class="text-muted text-xs block m-t-xs">${item.key.date}</span>
                </header>
                <div class="m-t-sm">${item.key.content}</div>
            </section>
        </article>
    </c:if>
</c:forEach>
